#for循环
a = [1,1]
def func(n):
    for i in range(1,n+1):
        if i==1 or i == 2:
            pass
        else:
            a.append(a[i-2]+a[i-3])
func(18)
print(a)

#while循环
n = 18
b = [1,1]
i = 2

while i < n:
         b.append(b[i-1]+a[i-2])
         i+=1



print(b)





class ParamsTypeError(Exception):
    pass

def fun(n):

    try:
        n = int(n)
        print(n)
    except:

        raise ParamsTypeError('Type error')
fun("1")



